﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Teacher_TeacherSalaryTrans_List : System.Web.UI.Page
{
    #region "Private Variabels"
    #endregion

    #region "Events"

    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void ddlSchoolList_SelectedIndexChanged(object sender, EventArgs e)
    {

    }

    protected void grvTeacherSalaryTrans_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (grvTeacherSalaryTrans.SelectedIndex >= 0)
        {
            DataKey _selectedDataKey = grvTeacherSalaryTrans.SelectedDataKey;
            int _TeacherSalaryTransKey = Convert.ToInt32(_selectedDataKey[0]);
            int _UserAccountKey = Convert.ToInt32(_selectedDataKey[1]);
            if (_TeacherSalaryTransKey > 0 && _UserAccountKey > 0)
            {
                lblSelectedTeacherSalaryTransKey.Text = _TeacherSalaryTransKey.ToString();
                lblSelectedTeacherUserAccountKey.Text = _UserAccountKey.ToString();
            }
        }
    }

    protected void btnShowTeacherSalaryTrans_Click(object sender, EventArgs e)
    {
        if (grvTeacherSalaryTrans.SelectedIndex >= 0)
        {
            DataKey _selectedDataKey = grvTeacherSalaryTrans.SelectedDataKey;
            int _TeacherProfileKey = Convert.ToInt32(_selectedDataKey[0]);
            int _UserAccountKey = Convert.ToInt32(_selectedDataKey[1]);
            if (_TeacherProfileKey > 0 && _UserAccountKey > 0)
            {
                lblSelectedTeacherSalaryTransKey.Text = _TeacherProfileKey.ToString();
                lblSelectedTeacherUserAccountKey.Text = _UserAccountKey.ToString();
            }
        }
    }

    protected void btnAddNew_Click(object sender, EventArgs e)
    {
        Response.Redirect("TeacherSalaryTrans-Entry.aspx?SchoolKey=" + ddlSchoolList.SelectedValue);
    }

    protected void grvTeacherSalaryTrans_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        int TeacherProfileKey = Convert.ToInt32(grvTeacherSalaryTrans.DataKeys[1].Value);
        int UserAccountkey = Convert.ToInt32(grvTeacherSalaryTrans.DataKeys[e.RowIndex].Value);

        bool result = TeacherSalaryTransTableManager.Delete(TeacherProfileKey);
    }

    protected void grvTeacherSalaryTrans_OnRowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            int index = e.Row.RowIndex;
            Label lblTeacherName = (Label) grvTeacherSalaryTrans.FindControl("lblTeacherName");
             
        }
        
    }

    #endregion

    #region "Methods"

    #endregion
}